#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <functional>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>

using namespace std;

struct ListNode {
    int val;
    ListNode* next;
    ListNode(int x) : val(x), next(NULL) {}
};

class Node {
   public:
    int val;
    Node* next;
    Node* random;

    Node(int _val) {
        val = _val;
        next = NULL;
        random = NULL;
    }
};

struct TreeNode {
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};

class MedianFinder {
    priority_queue<int> left;                               //大顶堆
    priority_queue<int, vector<int>, greater<int> > right;  //小顶堆

   public:
    MedianFinder() {}

    void addNum(int num) {
        left.push(num);
        right.push(left.top());
        left.pop();
        if (left.size() + 1 < right.size()) {
            left.push(right.top());
            right.pop();
        }
    }

    double findMedian() {
        if (right.size() > left.size()) {
            return right.top();
        }
        return (double)(left.top() + right.top()) / 2;
    }
};

int main() {
    cout << "Hello, World!";
    // Solution()
    return 0;
}
